Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rerun subset of periodic surging experiments that did not make it 9ka #17

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

andrewdnolan
Copy link
Owner

@andrewdnolan andrewdnolan commented Oct 8, 2024

About a third of the periodic surging experiment did not make it the end of the 9ka simulation. The purpose of this PR is to rerun those simulations that failed, with a bit more attention and babysitting this time around.

@andrewdnolan
Copy link
Owner Author

andrewdnolan commented Oct 9, 2024

Identifying incomplete runs

Assuming you have a PeriodicSurges_Timeseries_9ka.zarrr file as generated by expr/03_PeriodicSurge/run/crmpt12/postprocess_timeseries.py, we can identify the runs that did not make it past 8ka with:

import numpy as np
import xarray as xr

zarr_path = 'data/PeriodicSurges_Timeseries_9ka.zarr'

src = xr.open_dataset(zarr_path, engine='zarr')

nt = src.dims["t"]

betas = []
periods = []
for SP in src.SP:
    for beta in src.beta:
        da = src.sel(SP=SP, beta=beta).percent_temperate

        # number of nans
        nn = np.count_nonzero(da.isnull())
        # final valid timestep
        idx, = np.where(da.isnull())
        t_f = da.t.isel(t=idx[0]-1)

        if (nn > 1) & (t_f < 8e3):
            betas.append(float(beta))
            periods.append(float(SP))

np.savetxt("incomplete_runs.dat",  np.array([periods, betas]).T)

The incomplete_runs.dat file is then used by the expr/03_PeriodicSurge/make_experiment.py script in order to generate the run commands and job submission script for the simulations that need to be rerun.

Also updated readme with chunked simulations renaming instructions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant